import subprocess
import sys

ret1 = subprocess.check_output(["ls", "-l", "/dev/null"])
print "Ret1: ", ret1

ret2 = subprocess.check_output(["/bin/sh", "-c","ls -l non_existent_file ; exit 0"],stderr=sys.stdout)

print "Ret2: ", ret2
